<?php
use app\models\Configs;

use app\models\Skeys;

use app\models\Users;

require '../bootstrap.php';
require '../models/Users.php';
require '../models/Configs.php';
require '../models/Skeys.php';
$user_name = trim($_POST['name']);
$password = trim($_POST['password']);
$appkey = trim($_POST['appkey']);

$user = Users::getUser($user_name);
if(! empty($user) && $user['password'] == md5($password)){
	//验证成功,用户信息
	echo json_encode(array('code' => 0, 'user' => $user));
}else{
	//登录失败
	echo json_encode(array('code' => -1));
}

